home *** CD-ROM | disk | FTP | other *** search
/ PC User 2001 August / APC_Aug2001_CD2.iso / features / web_dev / files / mwjpp516.exe / %MAINDIR% / Tools / Html / insert Xmp.script < prev    next >
Encoding:
Text File  |  2001-06-19  |  897 b   |  33 lines

  1. !!Script
  2. // Copyright ⌐ 1997-1998 - Modelworks Software
  3.  
  4. /**
  5. @Tool: insert Xmp~wraps the current selection with 
  6. <XMP> ... </XMP> tags. 
  7. @EndTool: 
  8. @Summary: insert Xmp~wraps selection with the Xmp tag
  9. */
  10.  
  11. function DoCommand()
  12. {
  13.   var editor = getActiveEditor();
  14.   if (editor)
  15.   {
  16.     var selection = editor.getSelection();
  17.     var upperCaseHtmlTags = getMapFileValue("Preferences", "Upper Case HTML Tags", true);
  18.     if (upperCaseHtmlTags)
  19.     {
  20.       editor.insert(selection.endLineIndex, selection.endCharIndex, "</XMP>");
  21.       editor.insert(selection.startLineIndex, selection.startCharIndex, "<XMP>");
  22.     }
  23.     else
  24.     {
  25.       editor.insert(selection.endLineIndex, selection.endCharIndex, "</xmp>");
  26.       editor.insert(selection.startLineIndex, selection.startCharIndex, "<xmp>");
  27.     }
  28.     editor.setActive("Insert XMP Tag");
  29.   }
  30. }
  31.  
  32. !!/Script
  33.